import React from 'react';
import './List.css';
import 'antd/dist/antd.css';
import { Table } from 'antd';
import { Link } from 'react-router';

const List = React.createClass({
    pageConfig : {
        pageSize : 5
    },
    render() {
        const columns = [{
                title: '活动名称',
                dataIndex: 'name'
            }, {
                title: '开始时间',
                dataIndex: 'time',
            }, {
                title: '活动状态',
                dataIndex: 'status',
            },{
                title : '操作',
                dataIndex : 'operate',
                render : function (text, item) {
                return (
                <div>
                <Link to={"/activity/"+item.key} target='_blank'>编辑</Link>
                <span className="ant-divider" />
                <a href="#">删除</a>
                </div>
                );
            }
        }];
        const data = [];
        for (let i = 0; i < 13; i++) {
            data.push({
                key: i,
                name: `Edward King ${i}`,
                time: new Date(Date.now() + 8 * 3600 * 1000).toISOString().replace(/T|\..*Z/g,' ').trim(),
                status: `结束`,
            });
        }
        return (
            <div>
              <Table columns={columns} dataSource={data} pagination={this.pageConfig}/>
            </div>
        );
    },
});
export default List;
